package com.hugeyurt.controller;

import com.hugeyurt.util.DemoTask;
import jakarta.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController
{

   // @Resource
   // private DemoTask demoTask;

    @GetMapping("hello.do")
    public String test(String name)
    {
       // demoTask.sendAsynTask();
        return "hello world :" +name;
    }

    @GetMapping("view.do")
    @Cacheable(value="test",key="#id")
    public String getInfo(Integer id)
    {
        return "hello:"+id;
    }
}
